﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeBehind="HocVien.aspx.cs" Inherits="WTSQCB.HocVien" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        &nbsp; Quản lý học viên</p>
    <p>
        &nbsp;
        Thuộc:
        <asp:DropDownList ID="Lopddl" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="TenLop" DataValueField="MaLop" Width="150px">
        </asp:DropDownList>
    </p>
    <p>
        <asp:GridView ID="HocViendgv" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="MaHocVien" DataSourceID="SqlDataSource2" OnSelectedIndexChanged="HocViendgv_SelectedIndexChanged" Width="980px">
            <Columns>
                <asp:CommandField ButtonType="Button" SelectText="CHỌN" ShowSelectButton="True" />
                <asp:BoundField DataField="MaHocVien" HeaderText="Mã Học viên" ReadOnly="True" SortExpression="MaHocVien" />
                <asp:BoundField DataField="HoTen" HeaderText="Họ tên" SortExpression="HoTen" />
                <asp:BoundField DataField="DiaChi" HeaderText="Địa chỉ" SortExpression="DiaChi" />
                <asp:BoundField DataField="NgaySinh" HeaderText="Ngày sinh" ReadOnly="True" SortExpression="NgaySinh" />
                <asp:BoundField DataField="GioiTinh" HeaderText="Giới tính" SortExpression="GioiTinh" />
                <asp:BoundField DataField="CapBac" HeaderText="Cấp bậc" SortExpression="CapBac" />
                <asp:BoundField DataField="TenLop" HeaderText="Tên lớp" SortExpression="TenLop" />
            </Columns>
            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
            <RowStyle BackColor="White" ForeColor="#003399" />
            <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
            <SortedAscendingCellStyle BackColor="#EDF6F6" />
            <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
            <SortedDescendingCellStyle BackColor="#D6DFDF" />
            <SortedDescendingHeaderStyle BackColor="#002876" />
        </asp:GridView>
    </p>
    <p>
        &nbsp;
        <asp:Button ID="Thembtn" runat="server" OnClick="Thembtn_Click" Text="THÊM" Width="80px" />
        <asp:Button ID="Suabtn" runat="server" OnClick="Suabtn_Click" Text="SỬA" Width="80px" />
        <asp:Button ID="Xoabtn" runat="server" OnClick="Xoabtn_Click" OnClientClick="return confirm('Bạn có muốn XÓA không ?')" Text="XÓA" Width="80px" />
    </p>
    <p>
        &nbsp;
        Thông tin chi tiết:</p>
    <p>
        &nbsp;
        Mã Học viên:
        <asp:TextBox ID="MaHocVientxt" runat="server"></asp:TextBox>
    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="MaHocVientxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Họ tên&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :
        <asp:TextBox ID="TenHocVientxt" runat="server"></asp:TextBox>
    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TenHocVientxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Địa chỉ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :
        <asp:TextBox ID="DiaChitxt" runat="server"></asp:TextBox>
    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="DiaChitxt" ErrorMessage="RequiredFieldValidator" ForeColor="Red">*</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Sinh ngày&nbsp;&nbsp;&nbsp; :
        <asp:DropDownList ID="Ngayddl" runat="server" AutoPostBack="True">
        </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tháng:
        <asp:DropDownList ID="Thangddl" runat="server" AutoPostBack="True">
        </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Năm:
        <asp:DropDownList ID="Namddl" runat="server" AutoPostBack="True">
        </asp:DropDownList>
    </p>
    <p>
        &nbsp;
        Giới tính&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :
        <asp:DropDownList ID="GioiTinhddl" runat="server" AutoPostBack="True" Width="150px">
            <asp:ListItem>Nam</asp:ListItem>
            <asp:ListItem>Nữ</asp:ListItem>
        </asp:DropDownList>
    </p>
    <p>
        &nbsp;
        Cấp bậc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :
        <asp:DropDownList ID="CapBacddl" runat="server" AutoPostBack="True" Width="150px">
            <asp:ListItem>Hạ sĩ</asp:ListItem>
            <asp:ListItem>Trung sĩ</asp:ListItem>
            <asp:ListItem>Thượng sĩ</asp:ListItem>
        </asp:DropDownList>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="SELECT [MaLop], [TenLop] FROM [Lop]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="HocVienLoad" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="Lopddl" Name="malop" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>
</asp:Content>
